package com.zzptc.app;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class RegActivity extends AppCompatActivity {
    Button btn_ok;
    EditText et_name1;
    Button btn_reset;
    EditText et_pwd1;
    private static final String TAG = "RegActivity";
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_reg);
        init();
        event();

    }

    public void init(){
        btn_ok=findViewById(R.id.btn_ok);
        et_name1=findViewById(R.id.et_name1);
        btn_reset=findViewById(R.id.btn_reset);
        et_pwd1=findViewById(R.id.et_pwd1);
    }
    private void event(){
        btn_ok.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                //Log.d(TAG,"你点击我了");
                //准备回传 1、获取值  2、保存值到意图 3、回传
                String username =et_name1.getText().toString().trim();
                String password =et_pwd1.getText().toString().trim();
                Log.d(TAG,username);
                Intent intent=new Intent();
                intent.putExtra("unmane",username);
                intent.putExtra("pwd1",password);
                setResult(3,intent);
                finish();

            }
        });
    }

}
